<template>
  <el-table :data="tableData" border style="width: 100%" :row-key="tableRowKey" default-expand-all @selection-change="selectionChange">
    <slot name="table_column" />
  </el-table>
</template>

<script>
export default {
  name: 'Table',
  props: { tableData: { type: Array, default: () => [] }, tableRowKey: { type: String, default: 'id' }},
  data() {
    return {}
  },
  methods: {
    selectionChange(row) {
      console.log(row)
      this.$emit('onTableSelectionChange', row)
    }
  }

}
</script>
